/*判断用户是否是医生*/
var docto,userid;
ym.ajax({
	url : "/user/getUser",
	async : false,
	success : function(data){
		if(data.res == 1){
			var html ="";
			console.log(data);
			if(data.obj.type == 1){
				userid = data.obj.userId;
					html += '<a href="javascript:void(0);">';
					html += '<img src="../img/yimiao.png">';
					html += '<span class="am-navbar-label">问答</span>';
					html += '</a>';
					$('.doctoras').removeClass('yimiao');
					$('.doctoras').addClass('yimiao1');
			}else{
					html += '<a href="javascript:void(0);">';
					html += '<img src="../img/yimiao.png">';
					html += '<span class="am-navbar-label">疫苗</span>';
					html += '</a>';
					$('.doctoras').addClass('yimiao');
			}
			$('.doctoras').html(html);
			ym.ajax({
				url: "/askDoctor/queryDoctorId",
				param:{
					userId:userid
				},
				success: function (data){
				   docto = data.obj;
				}
			});
		}else{console.log("没有获取到当前用户的身份")}
		
	}
});

$('body').on('click','.yimiao1',function(){
	window.location.href="Doctor.html?doctorid="+docto+"&userid="+userid+"&a=2";
})